<template>
  <div class="error">
      <h1>你请求的页面不存在的，{{number}} 秒后返回登陆页面...</h1>
  </div>
</template>
<script>
export default {
  name: 'error',
  data(){
    return {
      number: 5
    }
  },
  created () {
    this.goLogin();
  },
  methods: {
    goLogin(){
      let timer = setInterval(() => {
        this.number--;
        if(this.number == 0){
          clearInterval(timer);
          this.$router.push({name: 'login'})
        }
      },1000)
    }
  }
}
</script>
<style lang="less" scoped>
  .error {
    height: 100%;
    width: 100%;
    h1 {
      text-align: center;
      margin-top: 100px;
    }
  }
  
</style>
